//
//  CMQuickRequest.m
//  CardManage
//
//  Created by 斌 on 2017/11/3.
//  Copyright © 2017年 mupay. All rights reserved.
//

#import "CMQuickRequest.h"

@implementation CMQuickRequest

+ (void)sendGetQuickRequestWithURLString:(NSString *)urlString
                             andDataDict:(NSMutableDictionary *)dict
                            successBlock:(void (^)(NSString *retData))successBlock{
    
    
    dict = [self addHeader:urlString :dict];
    
    [KDHttpRequest sendRequestWithURLString:urlString andDataDict:dict timeoutInterval:60.0f httpMethod:@"GET" successBlock: successBlock failedBlock:^(NSString *errMsg) {
        

        
    }];
    
    
}



+ (void)sendPostQuickRequestWithURLString:(NSString *)urlString
                              andDataDict:(NSMutableDictionary *)dict
                             successBlock:(void (^)(NSString *retData))successBlock{
    
    dict = [self addHeader:urlString :dict];
    
    
    [KDHttpRequest sendRequestWithURLString:urlString andDataDict:dict timeoutInterval:60.0f httpMethod:@"POST"  successBlock: successBlock failedBlock:^(NSString *errMsg) {
        

        
    }];
    
    
}


+ (NSMutableDictionary *)addHeader:(NSString *)urlString :(NSMutableDictionary *)dict{
    
    
    NSDictionary *infoDictionary = @{@"version_no":VAL_SYS_INFO_CLIENTVERSION,
                                     @"phoneOS":@"iOS",
                                     @"phoneType":kiOS_VERSION};
    
    
    [dict addEntriesFromDictionary: infoDictionary];//通用的公共
    
    
    return dict;
    
}

@end
